// Copyright (C) 2024 武汉凹语言科技有限公司
// SPDX-License-Identifier: AGPL-3.0-or-later

package applogo

import (
	"fmt"
	"time"
)

func PrintLogoSvg() {
	fmt.Print(logoSvg)
}

func PrintLogo(more bool) {
	switch {
	case is1010Day():
		fmt.Print(logo1010)
	case is1024Day():
		fmt.Print(logo1024)
	default:
		fmt.Print(logo)
	}

	if more {
		fmt.Print(moreLogos)
	}
	fmt.Println()
}

func is1010Day() bool {
	_, month, day := time.Now().Date()
	return month == 10 && day == 10
}

func is1024Day() bool {
	_, month, day := time.Now().Date()
	return month == 10 && day == 24
}

const logo = `
+---+    +---+
| o |    | o |
|   +----+   |
|            |
|     Wa     |
|            |
+------------+
`

const logo1010 = `
+---+    +---+
| o |    | o |
|   +----+   |
|            |
|    1010    |
|            |
+------------+
`

const logo1024 = `
+---+    +---+
| o |    | o |
|   +----+   |
|            |
|    1024    |
|            |
+------------+
`

const logoSvg = `<!--
// 版权 @2019 凹语言 作者。保留所有权利。
// https://wa-lang.org
-->

<svg xmlns="http://www.w3.org/2000/svg"
	viewBox="0 0 400 400" width="400" height="400"
	style="border: 0px solid red"
>

<path
	stroke="none" fill="LightSeaGreen"
	d="M60,50 h90 v100 h100 v-100 h90 l10,10 v280 l-10,10 h-280 l-10,-10 v-280"
/>

<path
	stroke="none" fill="white"
	d="M100,100 m-5,-5 h10 v10 h-10"
/>

<path
	stroke="none" fill="white"
	d="M400,100 m-100,0 m-5,-5 h10 v10 h-10"
/>

<path
	stroke="white" fill="none" stroke-width="8" stroke-linecap="round"
	d="M200,230 l34,34 l34,-34 M200,230 l-34,34 l-34,-34"
/>

</svg>
`

const moreLogos = `
+---+    +---+
| * |    | * |
|   +----+   |
|            |
|    \/\/    |
|            |
+------------+

+---+    +---+
| - |    | 0 |
|   +----+   |
|            |
|    \/\/    |
|            |
+------------+

+---+    +---+
| + |    | + |
|   +----+   |
|            |
|    +--+    |
|            |
+------------+

+---+    +---+
| & |    | % |
|   +----+   |
|            |
|    ^^^^    |
|            |
+------------+

+---+    +---+
| ~ |    | ~ |
|   +----+   |
|            |
|    7777    |
|            |
+------------+

+-----------+
| 0         |
+---+       |
    |   >   |
    |   >   |
+---+       |
| 0         |
+-----------+

  +---++---+
 / * /  \ * \
|   +----+   |
|            |
|    \/\/    |
|            |
+------------+

+---+        +---+
 \ * \      / * /
  |   +----+   |
  |            |
  |    \/\/    |
  |            |
  +------------+

+---+        +---+---+        +---+
 \ * \      / * / \ * \      / * /
  |   +----+   |   |   +----+   |
  |            |   |            |
  |    \/\/    |   |    \/\/    |
  |            |   |            |
  +------------+   +------------+

      +---+    +---+---+    +---+
     / o /    / o / \ ~ \    \ ~ \
    /   +----+   /   \   +----+   \
   /            /     \            \
  /    \/\/    /       \    /\/\    \
 /            /         \            \
+---+----+--- wa-lang.org ---+----+---+
 \ - \    \ - \         / + /    / + /
  \   +----+   \       /   +----+   /
   \            \     /            /
    \    \<<\    \   /    />>/    /
     \            \ /            /
      +------------+------------+

+---+    +---+
| o |    | o |
|   +----+   |
|            |
|    \/\/    |
|            |
+---+----+---+
 \ - \    \ - \
  \   +----+   \
   \            \
    \    \<<\    \
     \            \
      +---+----+---+
     / o /    / o /
    /   +----+   /
   /            /
  /    \/\/    /
 /            /
+---+----+---+
 \ - \    \ - \
  \   +----+   \
   \            \
    \    \<<\    \
     \            \
      +---+----+---+
     / o /    / o /
    /   +----+   /
   /            /
  /    \/\/    /
 /            /
+---+----+---+
| o |    | o |
|   +----+   |
|            |
|    \/\/    |
|            |
+---+----+---+
| o |    | o |
|   +----+   |
 \            \
  \    \/\/    \
   \            \
    +---+----+---+
    | o |    | o |
    |   +----+   |
   /            /
  /    \/\/    /
 /            /
+---+----+---+
| o |    | o |
|   +----+   |
 \            \
  \    \/\/    \
   \            \
    +---+----+---+
    | o |    | o |
    |   +----+   |
   /            /
  /    \/\/    /
 /            /
+------------+

      +---+----+---+
     / \ ~ \    \ ~ \
    /   \   +----+   \
   /     \            \
  //.     \    /\/\    \
 ///..     \            \
++++...     +---+----+---+
 \\\..     / + /    / + /
  \\.     /   +----+   /
   \     /            /
    \   /    />>/    /
     \ /            /
      +------------+

        ____     ____
      /    /\  /    /\
     /____/   /____/  \
     \    \   \    \ 0 \
      \    \   \    \   \
   ____     ____   __\   \
 /    /\  /    /\    /    \
/____/   /____/  \  /   7  \
\    \   \    \ 0 \/   7   /
 \ <> \   \ <> \      7   /
  \    \/__\    \    7   /
   \             \      /
    \    ~~~~     \    /
     \             \  /
      \_____________\/
`
